home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.6 KB | 72 lines | [TEXT/GEOL] |
- Item 8206312 31-Jan-91 21:40PST
-
- From: MUYSVASOVIC ACE - Jean-Denis Muys-Vasovic
-
- To: MACDTS Macintosh Developer Tech Supt
- MACAPP.TEST MacApp SQA Team
- APPLE.BUGS Apple Bugs Reporting
- DEV.TECH.PUB Developer Technical Pub
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Item forwarded by FRED.FORSMAN to HALPIN1
-
- ------------------------------------------------------------------------------
-
- Sub: bug in SetClikLoop
-
- Dear fellows,
-
- How happy we are: there is a bug in MacApp (2.0.1) which shows up only
- sometimes, and only in Debug mode. In fact the bug is in MacApp because it is
- in Inside Macintosh.
-
- Symptom: sometimes in debug mode, in a TTEView, you can't select the text by
- dragging. Sometimes a you can for a while, and suddenly when you drag, the
- selection stops to expand.
-
- Explanation: In TTEView.DoMouseCommand, There is a call to TEClick which
- returns even though the mouse button is still down. Why? Because MacApp
- installs a clickloop routine with SetClikLoop. IM describes the clickloop
- procedure as being:
-
- FUNCTION clikProc: BOOLEAN; or in C:
- typedef pascal Boolean (*ClikLoopProcPtr)(void);
-
- AND THIS IS WRONG. I traced in the ROM of several Macintoshes, and TEClick does
- JSR (A0) and BEQ.S exit. So the result should not be on the stack, as for any
- pascal Boolean function, but in the Z flag. At least if the function was
- declared as C, then the result would be in D0, with a slightly better chance
- for the Z flag to be OK.
-
- Why are we lucky? because the current MacApp implementation, which wrongly
- follows IM, generates code which happens to set the Z flag correctly.
- Unfortunately, in -Trace mode, there is a call to %_EP which sometimes trashes
- the Z flag.
-
- Fixes:
- 1- add the -NoTrace option to MABuild
- 2- in TTEView.IRes and TTEView.ITEView, comment out the line:
- SetClikLoop(@ClickLoopForTTEView, fHTE);
- 3- this is not really a fix, but should work. Bracket the ClickLoopForTTEView
- function definition between directives to turn trace mode off:
-
- {$PUSH}{$IFC qNames}{$D+}{$ELSEC}{$D-}{$ENDC}
-
- FUNCTION ClickLoopForTTEView: BOOLEAN;
- [ ... ]
-
- {$POP}
- 4- You can additionally redeclare ClickLoopForTTEView as a C function, but this
- not a fix either.
- 5- The real fix is to rewrite ClickLoopForTTEView in assembly to make sure it
- sets the Z flag correctly. I won't show it because it's easy to do, but ask for
- it if you need it.
-
- Now all of this might be very old stuff, in which case I apologize.
-
- Regards,
-
- Jean-Denis
-
-